function [ nletters topRow bottomRow leftColumn rightColumn ] = letterBoundariesInSingleLine( img )
    %Detects all the letters and outputs their boundaries in a single line
    %Image should be binary and comprise only 1 line of text
    
    %Start from column 1 and continue until there is a letter
    newLetterStartColumn = 1;
    %Number of letters detected
    nletters = 1;
    imWidth = size(img, 2);
    while 1
        %Get the new letter boundary
        [tr br lc rc] = bboxletter(img, newLetterStartColumn);
        topRow(nletters) = tr;
        bottomRow(nletters) = br;
        leftColumn(nletters) = lc;
        rightColumn(nletters) = rc;
        %If there are no letters left
        if leftColumn(nletters) == -1
            nletters = nletters - 1;
            break;
        end
        
        %Set the search start column to where the previous letter ended
        newLetterStartColumn = rightColumn(nletters) + 1;
        
        %If the previous letter ended at the right border of the image
        %Or in other words if it was the last letter in the image
        if newLetterStartColumn > imWidth
            break;
        end
        
        %Increment the letter count
        nletters = nletters + 1;
    end
end

